<?php

require_once(dirname(__FILE__)."/Smarty.class.php");
cload("requestProcessor");
cfgload("tplconfig");
cfgload("dd");
/**
 * Класс обёртка для Smarty
 *
 * @author Di_Moon
 */
class smartyRenderer extends Smarty {
    protected $_user;
    
    function __construct() {
        parent::__construct();
        
        $this->_user = _sessionUser();
        
        $this->assign("_userGuest", $this->_user->guest());
        $this->assign("_userName", $this->_user->get("name"));
        $this->assign("_userId", $this->_user->get("id"));
        
        $this->setTemplateDir(TPLConfig::tplDir());
        $this->setCompileDir(TPLConfig::compileDir());
        $this->setCacheDir(TPLConfig::cacheDir());
        $this->setConfigDir(TPLConfig::configDir());
        
        $a = requestProcessor::getVar("a");
        $frame = requestProcessor::getVar("frame", 0);
        $this->assign("SCRIPT_URL", $_SERVER['SCRIPT_NAME']."?frame=$frame");
        
        $this->assign("IS_FRAME", $frame);

        $this->assign("DOPDATA_FOR_FILM", DOPDATA_FOR_FILM);
        $this->assign("DOPDATA_FOR_DISTR", DOPDATA_FOR_DISTR);
        
        $this->assign("DOPDATA_TYPES", _dd_Types());
        $this->assign("DOPDATA_TYPES_INV", _dd_TypesInv());
        
        foreach(TPLConfig::urlActions() as $key=>$value) {
            $this->assign($key, $value);
        };
    }
    
    // Функция по рендеренгу сообщений об ошибках
    function getError($message, $type=TPL_ERR_WARNING) {
        return $message;
    }
}

?>
